package com.shundr.shipper.cargo;

import android.os.Bundle;

import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.shundr.shipper.R;
import com.shundr.shipper.base.BaseActivity;
/**
 *
 */
public class DeliverCargoActivity extends BaseActivity{
	private DeliverGoodsFragment mFragment;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		mActionBar.setDisplayShowHomeEnabled(false);
		setContentView(R.layout.activity_deliver_cargo);
		mFragment = (DeliverGoodsFragment)getSupportFragmentManager().findFragmentById(R.id.fragment_deliver);
	}
	
	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getSupportMenuInflater().inflate(R.menu.menu_confirm, menu);
		menu.getItem(0).setTitle("提交");
		return true;
	}
	
	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		switch (item.getItemId()) {
		case R.id.menu_confirm:
			mFragment.submit();
			break;

		default:
			break;
		}
		return super.onOptionsItemSelected(item);
	}
}
